//
//  ProductTableViewCell.m
//  Consume100
//
//  Created by eliot on 16/3/28.
//  Copyright © 2016年 aleven. All rights reserved.
//

#import "ProductTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation ProductTableViewCell

- (IBAction)relealeBtnClick:(id)sender {
    
    if (self.startCount > 0) {
        self.startCount -= 1;
        self.countLb.text = [NSString stringWithFormat:@"%d", self.startCount];
        self.checkProduct(@"-1", self.dataDic[@"productPrice"]);
    }
   
}


-(void)setDataDic:(NSDictionary *)dataDic {

        _dataDic = dataDic;
        [self.iconIV sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://192.168.1.188:8080%@", dataDic[@"productImg"]]]];
        self.titleLb.text = dataDic[@"productName"];
        self.selledCountLb.text = [NSString stringWithFormat:@"销量%@", dataDic[@"sale"]];
        self.priceLb.text = [NSString stringWithFormat:@"￥%ld", [dataDic[@"productPrice"] longValue]];
}

- (IBAction)addBtnClick:(id)sender {
    
    self.startCount += 1;
    self.countLb.text = [NSString stringWithFormat:@"%d", self.startCount];
    
    
    self.checkProduct(@"1", self.dataDic[@"productPrice"]);
    
}





- (void)awakeFromNib {
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
